cc.Class({
    extends: cc.Component,

    properties: {
        sprBg: cc.Sprite,

    },

    onLoad(){
        this.node.on('click', () => {
            G.audio.changeEffectMuteState();
            this._updateBtnAudio();
        }, this)
    },

    onEnable() {
        this._updateBtnAudio();
    },

    _updateBtnAudio() {
        let isMute = G.audio.getIsEffectMute();
        let url = 'components/effect/effect1';
        if (isMute) {
            url = 'components/effect/effect2';
        }
        G.common.setSpriteFrame(this.sprBg, url);
    },
    // update (dt) {},
});
